package entity.employee.impl;

import entity.employee.Employee;
import entity.employee.role.Role;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name = "employee")
public class EmployeeImpl implements Employee {

	private Long id;

	private String firstName;

	private String secondName;

	private Role role;

	public EmployeeImpl(String firstName, String secondName) {
		this.firstName = firstName;
		this.secondName = secondName;
	}

	@NotEmpty
	@Column(name = "firstName")
	public String getFirstName() {
		return firstName;
	}

	@Override
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@NotEmpty
	@Column(name = "secondName")
	public String getSecondName() {
		return secondName;
	}

	@Override
	public void setSecondName(String secondName) {
		this.secondName = secondName;
	}

	@NotEmpty
	@Column(name = "role")
	public Role getRole() {
		return role;
	}

	@Override
	public void setRole(Role role) {
		this.role = role;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}
